#!/bin/sh
[ $# -lt 1 ] && echo "file required" && exit 1
url=https://femto.pw/$(curl -F "upload=@$1" https://v2.femto.pw/upload | jq -r '.data.short')
[ $? -ne 0 ] && echo "some error occured" && exit 1
echo $url | xclip -sel clip
echo "copied $url to clipboard!"
